package com.tianji.learning.mapper;

import com.tianji.learning.domain.po.PointsBoardSeason;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author huanmo
 * @since 2025-09-24
 */
public interface PointsBoardSeasonMapper extends BaseMapper<PointsBoardSeason> {

    @Select("select * from points_board_season ORDER BY begin_time ASC")
    List<PointsBoardSeason> selectAll();

    @Select("SELECT * FROM points_board_season WHERE begin_time <= #{time} AND end_time >= #{time}")
    PointsBoardSeason selectCurrentSeason(@Param("time") LocalDateTime time);

}
